package org.giovanolli.mumi.dao;

import java.io.Serializable;
import java.util.List;

import org.giovanolli.mumi.entities.filter.EntityFilter;

/**
 * The Interface Dao.
 * 
 * @param <T>
 *            the generic type
 */
public interface Dao<T> {

	/**
	 * Delete.
	 * 
	 * @param obj
	 *            the obj
	 */
	public void delete(T obj);

	/**
	 * Evict.
	 * 
	 * @param obj
	 *            the obj
	 */
	public void evict(Object obj);

	/**
	 * 
	 * Gets the by id.
	 * 
	 * @param id
	 *            the id
	 * @return the by id
	 */
	public T getById(Serializable id);

	/**
	 * Gets the by uid.
	 * 
	 * @param uid
	 *            the uid
	 * @return the by uid
	 */
	public T getByUid(String uid);

	/**
	 * Gets the count.
	 * 
	 * @param filter
	 *            the filter
	 * @return the count
	 */
	public int getCount(EntityFilter<T> filter);

	/**
	 * Gets the list.
	 * 
	 * @param filter
	 *            the filter
	 * @return the list
	 */
	public List<T> getList(EntityFilter<T> filter);

	/**
	 * Gets the list.
	 * 
	 * @param filter
	 *            the filter
	 * @param from
	 *            the from
	 * @param quantity
	 *            the quantity
	 * @return the list
	 */
	public List<T> getList(EntityFilter<T> filter, int from, int quantity);

	/**
	 * Save.
	 * 
	 * @param obj
	 *            the obj
	 */
	public void save(T obj);
}
